February 02, 2020
R! R is a OpenSource Programming Language and Domain Specific, Used for Statistical computing and Graphical Methods. R includes Machine Learning Algorithm and Linear Regression. In R, we do data analysis and Develop ML Model and drive the conclusion. It handles lighter Datasets, Datasets with high volume of rows and columns, will be better handled by Python.
About R, and How it got introduced, all theory you can get in the internet. Now let us start with essential part which is needed for our DataScience learning.
Installation of R Studio // We should install R before R Studio.
We have others IDEs like Eclipse, Visual Studio, which can work as a platform for R. Widely used is R Studio.
As we all well grown professionals, I am just giving the link here for R and R Studio, where you can download suitable version for your OS, and install it just by giving next next..
link- https://cran.r-project.org/bin/windows/base/
Now Let us move to R Programming!!!
You can start writing the R code, in the R Studio top left corner, which is mentioned in above picture.R has few dafault datasets. We will work with that dataset first and then we will learn how to load a new dataset next.
Bottom left for Output in Console.
rm(list=ls())
data()
View(mtcars)
mc = mtcars
Hereafter we can use mc instead of mentioning mtcars. View(mc) // Viewing mtcars using the temp object
install.packages(“dmm”) // dmm is the package name here
You need to be connected to the Interet to install any packages.
Suppose if you want to see, first 3 rows and two columes the command is below
mc[1:3,1:2] // Provides first 3 rows and 2 columes
mc[1:5,] //Select first 5 rows and all columnes
a <- 10 //assigning 10 to tempobj a
b <- 3 //assiging 3 to tempobj b
c <- a + b //Now adding the values and assigning the output to C.
print (paste(c)) // Printing the value of C
You can also, directly enter the values and get the operations done.
I have taken one column named “cyl” in the preloaded dataset mtcars which is assigned to the object named “mc”.
There are few more basic commands which will be covered in next post. Stay tuned!!!!